package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.MemberCardDto;
import edu.suda.xsap.entity.MemberCard;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper(componentModel = "spring")
public interface MemberCardConvert {


    @Mapping(source = "id", target = "id")
    @Mapping(source = "name", target = "name")
    @Mapping(source = "price", target = "price")
    @Mapping(source = "description", target = "description")
    @Mapping(source = "note", target = "note")
    @Mapping(source = "type", target = "type")
    @Mapping(source = "totalCount", target = "totalCount")
    @Mapping(source = "totalDay", target = "totalDay")
    @Mapping(source = "status", target = "status")
    @Mapping(source = "createTime", target = "createTime")
    @Mapping(source = "lastModifyTime", target = "lastModifyTime")
    @Mapping(source = "version", target = "version")


    MemberCardDto toDto(MemberCard memberCard);

    List<MemberCardDto> toDtoList(List<MemberCard> memberCards);

    MemberCard toCardEntity(MemberCardDto memberCardDto);

}
